﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using AudioTester.WaveStreams;

namespace AudioTester
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
            this.DataContext = new Player_Model();
            _channelsLB.SelectedIndex = 0;
        }



        // Using a DependencyProperty as the backing store for Channels.  This enables animation, styling, binding, etc...
  
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var lb = ((ListBox)sender);
            var itm = lb.SelectedItem as DependencyObject;
            if (itm!=null)
            {
                var c = App.GetChannels(itm);
                App.SetChannels(lb, c);
            }
        }





        
  
   
    }
}